-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add time extension support #791
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Chris Jackson <[email protected]>
Hey @cdjackson. Thanks again for implementing this. I cherry-picked your changes onto zigbee-3.3.0 and zsmartsystems-1.4.7, because that's what my test setup is on and dropped updated jars into the I think the update went well, but the new extension is throwing an error: I'm attaching the full log (during startup with the modified jars in place) and a shorter log with the what I think are interesting lines copied out in chronological order: I could try upgading openhab to 3.4.1 (which is also using zsmartsystems-1.4.7) and retry the cherry-picking. Thanks, |
I realized the error
But we do add the cluster already in By the way, the Tuya device is asking for a server cluster: So I changed the code in
Now I'm getting farther (I think):
I'll keep working on it. |
Thanks @dschall - sorry for not picking this up yesterday - it's been one of those weeks :(
Agreed - much of this time code was actually written a couple of years back so I think this is probably a hangover from a change in concept wrt the lifecycle...
Thanks - much appreciated. Just shout if you have a question and I'll try and jump in... |
No worries, your PR was sitting for over a month until I had time to take a look. Even when changing the code to First issue, we're getting a nullptr exception:
I was able to fix that by setting the status in
Next, I believe we don't properly handle the request and send two responses. One inside
I finally played around with your changes in
The good news: It sorta worked, OH is responding to the Tuya device's request for time:
The bad news is that this doesn't stop the Tuya device from waking up and asking again every ~12 minutes: |
Thanks - I've fixed that now in the library branch.
I'll take a look at this. It's caused by the way that the commands are processed in this server class - again - this is something that changed since this was written.
I guess I'm not super surprised by this since it is not mandatory for a network to handle these commands it would be a bit silly to implement it in a way that requires it. That said, I guess these devices aren't really just mean to be used in "any old zigbee network", but are designed to be used with the Tuya gateway which means they don't "need" to stick to the standards. Anyway, I guess other than that you're still kind of at square one in understanding the poor battery performance? :( |
Yeah :( I was hoping by giving them what they want (a response to their time requests), they'd be happy and shut up for a longer period and stop draining the battery. But if you want to check in your time changes, let me know. I'd be happy to help get that in, so it wasn't all for nothing :) PS: I'm wondering if the Tuya devices expect something from this message, unrelated to time, but also send repeatedly every ~12 minutes:
But since it's unrelated to time, we can maybe tal about that on the Tuya thread.. |
Thanks - let me take a look and try and update this as it would be good to get it working :)
Do you have a sniffer? OI think that the Ember NCP should send a response to that, but I'm not 100% sure. |
Isn't OH3 sniffing all the communication, or are there additional packets exchanged that OH3 doesn't see? |
No - you won't see some traffic. You don't see any of the lower layer stuff (ie all the ACKs that are going on at network level) and other network traffic. I can't remember if these commands will be reflected back on the serial link or not if the NCP responds, but I believe that it should be (but again, I might be wrong). |
This adds the
ZigBeeTimeExtension
support which should provide a time server that devices can interview to get the current system time.This requires zsmartsystems/com.zsmartsystems.zigbee#1371
@dschall you might like to give this a go to see if it resolves the issues you have with the Tuya device that keeps requesting the time. To build/run this, you will need to compile the SNAPSHOT of the library using the branch linked above to get the time support. I've not really done any testing on this as I've not got a device that currently requires this, so I welcome any feedback.
Signed-off-by: Chris Jackson [email protected]